﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Script.Services;
using System.Web.Services;

namespace IMeiWeiWebService
{
    /// <summary>
    /// Summary description for AppClassificationWebService
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class AppClassificationWebService : System.Web.Services.WebService
    {
        IMeiWei.BLL.areatwo bll_areaTwo = new IMeiWei.BLL.areatwo();
        IMeiWei.BLL.areaone bll_areaOne = new IMeiWei.BLL.areaone();
        [WebMethod]
        public string HelloWorld()
        {
            return "Hello World";
        }

        [WebMethod]
        [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
        public string LoadAreaOneLeval()
        {
            var models = bll_areaOne.GetModelList(" 1 = '1'");

            return JsonHelper.GenJSSerializer(Context).Serialize(models);
        }

        [WebMethod]
        [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
        public string LoadAreaTwoLeval(string areaOneId)
        {
            var models = bll_areaTwo.GetModelList(" AreaOne_Id = '" + areaOneId + "'");

            return JsonHelper.GenJSSerializer(Context).Serialize(models);
        }
    }
}
